package com.sxau.software_educational_system_backend.utils;
import org.mindrot.jbcrypt.BCrypt;

public class PasswordUtils {
    // 加密密码（强度因子10-12）
    public static String hashPassword(String plainPassword) {
        return BCrypt.hashpw(plainPassword, BCrypt.gensalt(12));
    }

    // 验证密码
    public static boolean checkPassword(String plainPassword, String hashedPassword) {
        return BCrypt.checkpw(plainPassword, hashedPassword);
    }
}
